<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="Admin/webroot/css/style.css"/>
<title>添加产品</title>
</head>
<script type="text/javascript" src="Admin/webroot/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="Admin/webroot/js/global.js"></script>
<script type="text/javascript" src="Admin/webroot/js/input.js"></script>
<script type="text/javascript" src="Admin/webroot/js/weixin.js"></script>
<body >
<!--[if lte IE 6]>
<script src="js/DD_belatedPNG_0.0.8a.js" language="javascript" type="text/javascript"></script>
<script type="text/javascript">
	DD_belatedPNG.fix('.pngfix');
</script>
<![endif]-->
<div class="rightbox">
    	<div class="rightbox-col" id="rightbox">
        	<div class="main">
                 {include file='../Common/main_title.html'}
                <div class="bd">
                	<div class="height_20"></div>
                    <div class="add-pro-info">
                       
                            <div class="pro-info">
                            	<div id="pro">
                                    <div class="left-table"><span class="red">*</span>关键词：</div>
                                    <div class="right-table"><input type="text" name="keyword" value="{$art.keyword}" /></div>
                                    <div class="msg"></div>
                     <div class="height_10"></div>                                                   <div class="left-table"><span class="red">*</span>关联规则：</div>
<div class="right-table"><div class="s-select-c" style="z-index:999;">
                                        		<input type="text" autocomplete="off" name="parent_name" {if $art.rule_name}value="{$art.rule_name}"{else}value="请选择关联信息"{/if} class="s-select"/>
                                                <div class="s-select-menu" id="s1" style="z-index:999">
                                                	<ul>
           {foreach from=$rule_list item=list}                                          	<li data-select="{$list.id}"><a href="#">{$list.name}</a></li>
                                                        {/foreach}                                                </ul>
                                                </div>
                                                <input type="hidden" class="fmenu" name="rule_id" value="{$art.rid}" />
                                            </div></div>
                                                                        <div class="height_10"></div>
                         <div class="left-table"><span class="red">*</span>是否启用：</div>
                                    <div class="right-table">
                                     <a data-name='is_show' data-value="0"  {if $art.status}{if $art.status eq 0}class="selectBtn focus"{else}class="selectBtn"{/if}{else}class="selectBtn focus"{/if} href="javascript:;"> 是</a>
                                            <a data-name='is_show' data-value="1"   {if $art.status eq 1}class="selectBtn focus"{else} class="selectBtn"{/if}  href="javascript:;">否</a>
                                            <input type="hidden" name="is_show"  value="{if $art.status}{$art.status}{else}0{/if}"/>
                                    
                                    </div>
                                    <div class="msg"></div>
                     <div class="height_10"></div>               <div class="left-table"><span class="red">*</span>匹配方式：</div>
                                    <div class="right-table"><div class="s-radio-x">
                                                <a data-name='type' data-value="1"  {if $art.type}{if $art.type eq 0}class="selectBtn focus"{else}class="selectBtn"{/if}{else}class="selectBtn focus"{/if} href="javascript:;"> 全字</a>
                                            <a data-name='type' data-value="0"   {if $art.type eq 1}class="selectBtn focus"{else} class="selectBtn"{/if}  href="javascript:;">包含</a>
                                            <input type="hidden" name="type"  value="{if $art.type}{$art.type}{else}1{/if}"/>
                                            </div></div>
                                  
                     <div class="height_10"></div>
                                </div>
                            </div>
                            <div class="height_20"></div>
                            <div class="pro">
                            	
                                
                            </div>
                            
                            
                            <div class="height_20"></div>
                          
                            <input type="hidden" name="id" value="{$id}" />
                          <input type="button" class="submit_btn pro-add-sub"  value="保存"/>
                            <div class="height_24"></div>
                       

                    </div>
                </div>
            </div>
        </div>
         
        <div class="clear"></div>
    </div>
<script type="text/javascript" src="Admin/webroot/js/editor/kindeditor.js"></script>
<script type="text/javascript">
    $(function(){
		$('.pro-add-sub').click(function(){
			var action = '{$action}';
		var rule_id=($('input[name=rule_id]').val());
			var id=($('input[name=id]').val());
			
			
			var keyword=($('input[name=keyword]').val());
			if(keyword==''||rule_id==0)
			{
				showMsg('请完善信息');
				return;
			}
		var is_show=($('input[name=is_show]').val());
			var type=($('input[name=type]').val());
			$.post('index.php?g=admin&m=wxkey&a='+action,{ id:id,rule_id:rule_id,keyword:keyword,status:is_show,type:type},function(result){
				//alert(result);
			showMsg(result.content,result.url);
				},'json');
			})
		
		});

</script>
<script type="text/javascript">
$(".next-hd").click(function(){
	var html=$(this).find("span").attr("class");
	if(html=='icon-c'){
		$(this).next(".bd").show();
		$(this).find("span").attr('class','focus');
		
	}else{
		$(this).next(".bd").hide();
		$(this).find("span").attr('class','icon-c');
	}
})
var i=1;

</script>
</body>
</html>
